package tcp;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;

public class TcpClient {
	public static void main(String[] args) throws Exception {
		Socket socket = new Socket("127.0.0.1", 8888);
		BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
		OutputStream outputStream = socket.getOutputStream();
		String line = reader.readLine();
		System.out.println(line);
		outputStream.write("jason\r\n".getBytes());
		line = reader.readLine();
		System.out.println(line);
		reader.close();
		socket.close();
		
	}

}
